/*
 * Created on Oct 22, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.hermeneute.fsa;

import java.util.Comparator;

/**
 * @author mauceri
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class FSTInputTransitionComparator implements Comparator {
	int idxt[];
	public FSTInputTransitionComparator (int idxt[]) {
		this.idxt = idxt;
	}
    public int compare(Object o1, Object o2) {
    	FSTTransition t1 = (FSTTransition) o1;
    	FSTTransition t2 = (FSTTransition) o2;
    	int i1 = idxt[(int)t1.getEvent().input];
    	int i2 = idxt[(int)t2.getEvent().input];
    	if (i1 == i2){
    		return 0;
    	}else if  (i1 > i2){
    		return 1;
    	}else {
    		return -1;
    	}
    }
}
